package com.candy.candyproduct.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.candy.candyproduct.bean.Product;
import com.candy.candyproductservice.dto.ProductDTO;
import org.apache.ibatis.annotations.Update;

/**
 * @author suYanLong
 * @version 1.0
 * @date 2023/3/28 14:44
 * @Description 描述
 */
public interface ProductMapper extends BaseMapper<Product> {

    @Update("update product set pro_num = pro_num - #{subNum} where id = #{id} and pro_num > #{subNum}")
    Integer subProduct(ProductDTO productDTO);

}
